<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>MySQL 管理系统</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <style>
        .sidebar {
            height: 100vh;
            background-color: #f8f9fa;
            padding: 20px;
        }
        .main-content {
            padding: 20px;
        }
        .database-item {
            cursor: pointer;
        }
        .table-item {
            cursor: pointer;
            margin-left: 20px;
        }
    </style>
</head>
<body>
    <div class="container-fluid">
        <div class="row">
            <!-- 左侧边栏 -->
            <div class="col-md-3 sidebar">
                <h4>数据库列表</h4>
                <div id="databaseList"></div>
            </div>
            
            <!-- 主要内容区 -->
            <div class="col-md-9 main-content">
                <ul class="nav nav-tabs" id="mainTabs">
                    <li class="nav-item">
                        <a class="nav-link active" data-bs-toggle="tab" href="#sqlQuery">SQL查询</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" data-bs-toggle="tab" href="#tableData">表数据</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" data-bs-toggle="tab" href="#structure">表结构</a>
                    </li>
                </ul>
                
                <div class="tab-content mt-3">
                    <!-- SQL查询面板 -->
                    <div class="tab-pane fade show active" id="sqlQuery">
                        <div class="mb-3">
                            <textarea class="form-control" id="sqlInput" rows="5" placeholder="输入SQL语句..."></textarea>
                        </div>
                        <button class="btn btn-primary" onclick="executeSQL()">执行</button>
                        <div id="queryResult" class="mt-3"></div>
                    </div>
                    
                    <!-- 表数据面板 -->
                    <div class="tab-pane fade" id="tableData">
                        <div id="tableDataContent"></div>
                        <nav id="tablePagination" class="mt-3"></nav>
                    </div>
                    
                    <!-- 表结构面板 -->
                    <div class="tab-pane fade" id="structure">
                        <div id="tableStructure"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    <script src="/js/main.js"></script>
</body>
</html> 